// Problem: P1011 [NOIP1998 提高组] 车站
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1011
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<iostream>

using namespace std;

int a,n,m,x,f[20];

int main()
{
	cin>>a>>n>>m>>x;
	if(n==1) cout<<a;
	f[1]=1;
	for(int i=2;i<n;++i)
	{
		f[i]=f[i-1]+f[i-2];
	}
	int b=(m-(f[n-3]+1)*a)/(f[n-2]-1);
	cout<<(f[x-2]+1)*a+(f[x-1]-1)*b<<endl;
	return 0;
}